package com.codemart.lanze.modules.sys.model;

import java.io.Serializable;

import javax.validation.constraints.NotNull;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.codemart.lanze.common.base.entity.BaseEntity;
import com.codemart.lanze.common.validator.group.All;
import com.codemart.lanze.common.validator.group.Create;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @description: 角色
 * @author: lanze
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "tb_role", resultMap = "BaseResultMap")
public class Role extends BaseEntity<Role> {

	@TableField(exist = false)
	private static final long serialVersionUID = 1L;

	// 超级管理员标识
	public static final String ROLE_TYPE = "ROEL_ADMIN";

	/**
	 * 角色名
	 */
	@NotNull(message = "角色不能为空!", groups = { All.class })
	private String name;

	/**
	 * 角色标识
	 */
	@NotNull(message = "角色标识不能为空!", groups = { All.class })
	private String perms;

	/**
	 * 备注
	 */
	@NotNull(message = "备注不能为空!", groups = { Create.class })
	private String remark;

	/** 创建时间 */
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "创建时间")
	private java.util.Date createTime;

	/** 创建者 */
	@ApiModelProperty(value = "创建者")
	private java.lang.String createBy;

	/** 更新时间 */
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "更新时间")
	private java.util.Date updateTime;

	/** 更新者 */
	@ApiModelProperty(value = "更新者")
	private java.lang.String updateBy;

	/** delFlag */
	@ApiModelProperty(value = "delFlag")
	private java.lang.String delFlag;

	@Override
	protected Serializable pkVal() {
		return getId();
	}
}
